import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import path from "path"; //导入nodejs的path模块【如提示报错：安装“@types/node”】

// https://vite.dev/config/
export default defineConfig({
  plugins: [vue()],
  server: {
    port: 7070,
    //配置网络请求代理 - 解决axios跨域请求
    proxy: {
      "/admin": {
        target: "http://localhost:9090",
        changeOrigin: true,
      },
    },
  },
  //配置模块解析行为
  resolve: {
    //配置别名
    alias: {
      "@": path.resolve(__dirname, "./src"),
    },
  },
});
